const exp = /\[(\d{2}):(\d{2})\.(\d{2,3})\]/
export default function changeLyricStructure(lyric) {
  const lyricArr = []
  const oldArr = lyric.split('\n')
  
  for (let e of oldArr) {
    if (!e) continue
    let text;
    let time;
    let res = exp.exec(e)
    time = res[1]*60000 + res[2]*1000+res[3]*1
    text = e.replace(exp, '')
    lyricArr.push({time, text})
  }
  return lyricArr
}